package com.macro.mall;

import com.macro.mall.domain.UmsMember;
import com.macro.mall.mapper.UmsMemberMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.crypto.password.PasswordEncoder;

@SpringBootApplication
public class MallMemberApplication implements CommandLineRunner {
//	@Autowired
//	private PasswordEncoder passwordEncoder;
//	@Autowired
//	private UmsMemberMapper umsMemberMapper;

	public static void main(String[] args) {
		SpringApplication.run(MallMemberApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
//		System.out.println("创建账号");
//		UmsMember umsMember = new UmsMember();
//		umsMember.setStatus(1);
//		umsMember.setMemberLevelId(4L);
//		umsMember.setUsername("mytest");
//		umsMember.setPassword("mytest");
//		umsMember.setPassword(passwordEncoder.encode(umsMember.getPassword()));
//		umsMemberMapper.insertSelective(umsMember);
//		System.out.println("创建账号成功");
	}
}
